package com.HospitalOutpatient.service.impl;

import com.HospitalOutpatient.dao.PatientDao;
import com.HospitalOutpatient.entity.Patient;
import com.HospitalOutpatient.service.PatientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("patientService")
public class PatientServiceImpl implements PatientService {

    @Autowired
    private PatientDao patientDao;

    public List<Patient> getPatientByUserId(String userId){
        return patientDao.selectPatientByuserId(userId);
    }

    @Override
    public boolean addPatinet(Patient patient) {
        return patientDao.addPatient(patient) >= 1;
    }

    @Override
    public boolean deletePatient(String patientId) {
        return patientDao.deletePatient(patientId) >= 1;
    }
}
